Sound 101
Volume Number: 9
Issue Number: 3
Column Tag: C Workshop
Related Info: Sound Manager
Sound 101
Evolution of the Mac voice
By Iggi Monahelis, Pleasanton, California
Note: Source code files accompanying article are located on MacTech CD-ROM or
source code disks.
About the author
Iggi Monahelis is a programmer who bought his first Mac as soon as he could back
in 1984. He is the principal designer and co-author of “Read My Lips”, the sound
annotation utility for the Macintosh.
Introduction
This is an introductory article, hence the name Sound 101, dealing with basic
recording and playback of sounds on the Macintosh. It explains the required steps to be
taken in order to digitize sounds using a microphone, in two different sound formats,
and play them back. It is a good stepping stone for someone who has little or no
knowledge of how to do these things in a program on the Macintosh. As a matter of fact,
one can probably copy the routines given in the article, and use them in their own
program without a lot of modifications.
Ancient History
The Macintosh has had the capability of producing sounds since day one. The
famous introduction of the Macintosh back in 1984 used sound, in the form of digitized
speech, to allow the Mac to introduce itself. Inside Macintosh back then had a chapter
on the Sound Driver with just a few routines, literally StartSound, StopSound and
SoundDone, that allowed the programmer to control the Sound Driver. The Sound
Driver produced sound using three different sound synthesizers:
1) the four-tone synthesizer, used to make simple harmonic tones, with up to four
“voices” producing sound simultaneously. Hence the name four-tone.
2) the square-wave synthesizer, used to produce sounds such as beeps.
3) the free-form synthesizer, used to produce complex sounds, music and speech.
You had to “describe” the sound to the Driver as a waveform, basically fill a
buffer with a bunch of numbers, and tell the Sound Driver to start producing noise
based on these numbers. Very primitive.
Middle Ages
With the introduction of the Macintosh II class of machines, the Sound Driver had
graduated to the Sound Manager. It was indeed a graduation because several innovations
had taken place:
1) The hardware now included a new sound chip which freed the machine’s processor
from doing all the work.
2) The introduction of sound resources. Sound resources can “contain” any sound
you can imagine, from a simple beep sound to digital recordings of CD’s. And
because they are resources, in the Macintosh sense of the word, you can work
with them using standard Resource Manager calls. To play a sound resource all
you have to do is load it and pass the handle to the resource to the SndPlay
routine.
3) The Sound Manager now has seven routines to allow you to work with sound.